package com.aiju.widgit.dialog;

import android.content.Context;
import android.view.Gravity;
import android.view.View;
import android.view.WindowManager;
import android.widget.TextView;

import com.aiju.base.R;
import com.aiju.base.dialog.BaseDialog;
import com.aiju.common.PixValue;

/**
 * @author: 佐为
 * @date: 2016-11-23 17:45
 * @version: V1.0
 * @Description: 等待加载对话框
 */
public class WaitDialog extends BaseDialog{

    public WaitDialog(Context context) {
        super(context);
    }

    @Override
    protected int getDialogStyleId() {
        return R.style.LodingDialogStyle;
    }

    @Override
    protected View getView() {
        View inflate = mLayoutInflater.inflate(R.layout.dialog_loading, null);
        TextView loadTextView= (TextView) inflate.findViewById(R.id.id_tv_loadingmsg);
        loadTextView.setText("正在加载中...");
        return inflate;
    }

    /**
     * 设置对话框LayoutParams
     *
     * @return
     */
    public WaitDialog setLayoutParams() {
        WindowManager.LayoutParams lp = getDialogWindow().getAttributes();
        lp.width = PixValue.dp.valueOf(317);
        lp.height = PixValue.dp.valueOf(165);
        getDialogWindow().setGravity(Gravity.CENTER);
        getDialogWindow().setAttributes(lp);
        return this;
    }

}
